<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>老人生活方式从表列表</title>
	<#include "/common/resource.ftl">
</head>
<body>

<div class="ui-operation">
    <div class="ui-search-items layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">多规则验证:</label>
                <div class="layui-input-inline">
                    <input type="text" name="number" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">验证日期</label>
                <div class="layui-input-inline">
                    <input type="text" name="date" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">验证链接</label>
                <div class="layui-input-inline">
                    <input type="tel" name="url" class="layui-input">
                </div>
            </div>
        </div>
    </div>
    <div class="ui-buttons">
        <div class="layui-btn-group tools">
            <@auth code='elderLifeStyle_add'><button class="layui-btn layui-btn-normal open-dialog" p="url:'${params.contextPath}/view/business/elderLifeStyle/elderLifeStyle_edit.htm',title:'添加老人生活方式从表',width:'600px',height:'400px'"><i class="fa fa-plus"></i>添加</button></@auth>
            <@auth code='elderLifeStyle_update'><button class="layui-btn layui-btn-normal singleSelected" p="url:'${params.contextPath}/view/business/elderLifeStyle/elderLifeStyle_edit.htm',title:'编辑老人生活方式从表',width:'600px',height:'400px'"><i class="fa fa-pencil"></i>修改</button></@auth>
            <@auth code='elderLifeStyle_delete'><button class="layui-btn layui-btn-normal remove-button" reurl="${params.contextPath}/web/elderLifeStyle/delete.json"><i class="fa fa-remove"></i>删除</button></@auth>
        </div>
        <div class="ui-searchs">
            <div class="value"><input type="text" name="name" value="" placeholder="名称"/></div>
            <input type="button" value="搜索" class="layui-btn layui-btn-danger search-button"/>
        </div>
    </div>
</div>
<div class="ui-content" style="padding-left: 10px;padding-right:10px;">
    <table id="datagrid" options="url:'${params.contextPath}/web/elderLifeStyle/list.json',params:'getSearchParams',dblClickRow:'showDetail'">
        <thead>
			<tr>
				<th data-options="field:'id',checkbox:true"></th>
				<th data-options="field:'id',width:100,align:'left'">主键</th>
				<th data-options="field:'elderHealthId',width:100,align:'left'">老人健康主表id</th>
				<th data-options="field:'physicalExerciseRate',width:100,align:'left'">体育锻炼频率(字典项)</th>
				<th data-options="field:'physicalExerciseTime',width:100,align:'left'">每次锻炼时间(分钟)</th>
				<th data-options="field:'physicalExerciseYears',width:100,align:'left'">坚持锻炼(年)</th>
				<th data-options="field:'physicalExerciseMod',width:100,align:'left'">锻炼方式</th>
				<th data-options="field:'dietaryHabit',width:100,align:'left'">饮食习惯(字典项)</th>
				<th data-options="field:'smokeStatus',width:100,align:'left'">吸烟状况(字典项)</th>
				<th data-options="field:'smokeDailyNum',width:100,align:'left'">日吸烟量</th>
				<th data-options="field:'smokeStartAge',width:100,align:'left'">开始吸烟年龄</th>
				<th data-options="field:'smokeEndAge',width:100,align:'left'">戒烟年龄</th>
				<th data-options="field:'drinkStatus',width:100,align:'left'">饮酒状况(字典项)</th>
				<th data-options="field:'drinkDailyNum',width:100,align:'left'">日饮酒量(两)</th>
				<th data-options="field:'isAbstinence',width:100,align:'left'">是否戒酒(字典项)</th>
				<th data-options="field:'abstinenceAge',width:100,align:'left'">戒酒年龄</th>
				<th data-options="field:'drinkStartAge',width:100,align:'left'">开始饮酒年龄</th>
				<th data-options="field:'isDrunkennessInOneYear',width:100,align:'left'">近一年是否饮酒(字典项)</th>
				<th data-options="field:'drinkKind',width:100,align:'left'">饮酒种类(字典项)</th>
				<th data-options="field:'drinkKindOtherName',width:100,align:'left'">饮酒种类其他名称</th>
				<th data-options="field:'isOccupationalHazardExposureHistory',width:100,align:'left'">是否职业病危害因素接触史(字典项)</th>
				<th data-options="field:'occupationalHazardProfession',width:100,align:'left'">职业病工种</th>
				<th data-options="field:'occupationalHazardYears',width:100,align:'left'">职业病从业年数</th>
				<th data-options="field:'dustType',width:100,align:'left'">粉尘种类</th>
				<th data-options="field:'isDustProtect',width:100,align:'left'">是否粉尘防护(字典项)</th>
				<th data-options="field:'radiogenicType',width:100,align:'left'">放射物质种类</th>
				<th data-options="field:'isRadiogenicProtect',width:100,align:'left'">是否放射物质防护(字典项)</th>
				<th data-options="field:'physicalFactorType',width:100,align:'left'">物理因素种类</th>
				<th data-options="field:'isPhysicalFactorProtect',width:100,align:'left'">是否物理因素防护(字典项)</th>
				<th data-options="field:'chemicalSubstancesType',width:100,align:'left'">化学物质种类</th>
				<th data-options="field:'isChemicalSubstancesProtect',width:100,align:'left'">是否化学物质防护(字典项)</th>
				<th data-options="field:'otherType',width:100,align:'left'">其他毒物</th>
				<th data-options="field:'isOtherProtect',width:100,align:'left'">其他毒物是否防护(字典项)</th>
				<th data-options="field:'isDel',width:100,align:'left'">是否删除(1是，2否)</th>
				<th data-options="field:'createId',width:100,align:'left'">创建人id</th>
				<th data-options="field:'createTime',width:100,align:'left'">创建时间</th>
				<th data-options="field:'modifyId',width:100,align:'left'">修改人id</th>
				<th data-options="field:'modifyTime',width:100,align:'left'">修改时间</th>
			</tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function getSearchParams() {
        return {name: $("input[name='name']").val()};
    }
    var showDetail = function (index, row) {
        <@auth code='elderLifeStyle_detail'>
            var url = "${params.contextPath}/view/business/elderLifeStyle/elderLifeStyle_detail.htm?id=" + row.id;
            DialogManager.openDialog("url:'" + url + "',title:'老人生活方式从表详情',width:'600px',height:'600px'");
        </@auth>
    };
    //formatter:formatState
    function formatState(val, row) {
    }

    $(function () {
        $(".remove-button").click(function () {
            var ids = DataGrid.getCheckedIds();
            if (ids == "") {
                layer.msg("请选择删除记录")
                return false;
            }
            var url = $(this).attr("reurl");
            layer.confirm('确定删除记录', function () {
                $.ajaxRequest({
                    type: 'post',
                    url: url,
                    data: {ids: ids.join(",")},
                    success: function (data) {
                        $.message(data.message);
                        if (data.success) {
                            DataGrid.reload();
                        }
                    }
                });
            });
        });
    });
</script>
</body>

</html>
